#!coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
"""
Django settings for PaySysMonitor project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))  # @UndefinedVariable
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'e-xaomf5_lha+x)5a4i46p4@gu1u*43@-+1s$1qh@2-_41jnhr'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True  # @UndefinedVariable

TEMPLATE_DEBUG = True  # @UndefinedVariable

ALLOWED_HOSTS = []




# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'zto',
    'weixin',
    'memcenter',
    'ckeditor',
    'ckeditor_uploader',
#     'django_crontab',
)

CKEDITOR_UPLOAD_PATH = "uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_JQUERY_URL = '/js/jquery-1.8.2.min.js'
CKEDITOR_CONFIGS = {
    'default': {
    'language' : 'zh-cn',
    'toolbar': 'Full',
    'height': 400,
    'width': 1000,
    'toolbar_Full' : [
       ['Source','-','Save','NewPage','Preview','-','Templates'],
       ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
       ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
       ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
       '/',
       ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
        ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
        ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
        ['Link','Unlink','Anchor'],
       ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
       '/',
        ['Styles','Format','Font','FontSize'],
        ['TextColor','BGColor']
    ]
    },
    
    'awesome_ckeditor': {
    
    'toolbar': 'Basic',

    },
}       
   
CRONJOBS = (
    # 初级模式
    ('*/1 * * * *', 'zto.cron.my_scheduled_job'),
)   

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
#     'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
#     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'zto.urls'

WSGI_APPLICATION = 'zto.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'zto',                      # Or path to database file if using sqlite3.
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': '123456',                  # Not used with sqlite3.
        'HOST': '127.0.0.1',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '3306',
        # 'USER': 'hujin',                      # Not used with sqlite3.
        # 'PASSWORD': 'hujin',                  # Not used with sqlite3.
        # 'HOST': '192.168.1.210',                      # Set to empty string for localhost. Not used with sqlite3.
        # 'PORT': '3306',                      # Set to empty string for default. Not used with sqlite3.
    }
}

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates/').replace('\\', '/'),  # @UndefinedVariable
)

# print TEMPLATE_DIR
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'zh-hans'

TIME_ZONE = 'Asia/Shanghai'

USE_I18N = True  # @UndefinedVariable

USE_L10N = True  # @UndefinedVariable

USE_TZ = True  # @UndefinedVariable



MEDIA_ROOT = os.path.join(BASE_DIR,'media')  # @UndefinedVariable

MEDIA_URL = '/media/'

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    #os.path.join(BASE_DIR, "static"),
    #'/var/www/static/',
#     os.path.join(BASE_DIR, "static/").replace('\\','/'),  # @UndefinedVariable
)

STATIC_ROOT = os.path.join(BASE_DIR, "static/").replace('\\','/')

#物流配置信息
company_id='0b60240597ea4d76916ed6287a4fabae';
key='80E574A99881B673ED7C20A529E56D29';

#微信接口信息
WEIXIN_APPID = 'wx781b55f58cd9eaff'
WEIXIN_SECRET = '56b93c572a401ecb49b0056ac51b9b69'
WEIXIN_TOKEN = 'zto'

#测试微信信息
# WEIXIN_APPID = 'wx781b55f58cd9eaff'
# WEIXIN_SECRET = '56b93c572a401ecb49b0056ac51b9b69'

